package com.haibara.codesubmiteval.model.vo;

import lombok.Builder;
import lombok.Data;

/**
 * @Author: mengyu
 * @Date: 2025/2/19
 */
@Data
@Builder
public class Top10VO {
    private Long userId;
    private Integer score;
    private Long acceptedQuestionNumber;
    private Integer rank;

    /**
     * 根据id返回Redis榜单中存储的Top10VO数据
     * Redis榜单中的Top10VO只存储了userId，所以需要构建对应的JSON字符串格式
     *
     * @param userId 用户id
     * @return Top10VO JSON字符串
     */
    public static String getTop10VOString(Long userId) {
        return "{\"userId\":" + userId + "}";
    }
}
